package xmpp.androidpush.service;

import android.util.Log;

import org.jivesoftware.smack.XMPPConnection;

public class XmppStreamHandler {
    private static final String TAG = "yaxim.StreamHandler";

    public static class ExtXMPPConnection extends XMPPConnection {

        public ExtXMPPConnection(org.jivesoftware.smack.ConnectionConfiguration config) {
            super(config);
        }

        public void shutdown() {
            try {
                // Be forceful in shutting down since SSL can get stuck
                //try {
                //    socket.shutdownInput();
                //} catch (Exception e) {
                //}
                //socket.close();
                shutdown(new org.jivesoftware.smack.packet.Presence(
                        org.jivesoftware.smack.packet.Presence.Type.unavailable));

            } catch (Exception e) {
                Log.e(TAG, "error on shutdown()", e);
            }
        }
    }
}
